function Logger(value, context) {
    console.log('logger value:', value)
    console.log('logger context:', context)
    const { kind, name, static: Static, private: Private } = context;
    console.log(Static, Private);

    // 如果kind是 getter 是访问器装饰器
    if (kind === "method" || kind === 'getter' || kind === 'setter') {
        return function (...args) {
            console.log(`starting ${name} with arguments: ${args.join(",")}`);
            const resuslt = value.call(this, ...args);
            console.log(`ending ${name}`);
            return resuslt;
        };
    }

    // 如果kind是 field 装饰的字段
    if (kind === 'field') {
        return function (initValue) {
            console.log(name, '初始值:' + initValue)
            return initValue + 1;
        }
    }
}
class myClass {
    @Logger private x = 1;
    getX(){
        return this.x;
    }
}

let clazz = new myClass();
console.log(clazz.getX());
